//
//  FirstVC.m
//  massage
//
//  Created by 李志权 on 2016/12/13.
//  Copyright © 2016年 李志权. All rights reserved.
//

#import "FirstVC.h"
#import "LoginVC.h"
#import "SelectEquipmentVC.h"
@interface FirstVC ()
@property (weak, nonatomic) IBOutlet UIButton *registerBtn;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *registerConstraint;
@property (weak, nonatomic) IBOutlet UIButton *loginBtn;

@end

@implementation FirstVC
- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [self.navigationController setNavigationBarHidden:YES animated:NO];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    [self.navigationController setNavigationBarHidden:YES animated:NO];
   
    self.registerBtn.backgroundColor = [UIColor colorWithWhite:0 alpha:0.7];
    self.registerConstraint.constant = (Width-55)/2;
    [self.registerBtn setShearRound:5 masksToBounds:YES borderWidth:0 borderColor:nil];
    //为透明度设置渐变效果
    UIColor *colorOne = [UIColor colorWithRed:(61/255.0)  green:(230/255.0)  blue:(114/255.0)  alpha:0.7];
    UIColor *colorTwo = [UIColor colorWithRed:(41/255.0)  green:(189/255.0)  blue:(237/255.0)  alpha:0.7];
    
    CAGradientLayer *gradientLayer =  [CAGradientLayer layer];
    gradientLayer.frame = CGRectMake(0, 0, (Width-55)/2, 45);
    //设置颜色
    [gradientLayer setColors:[NSArray arrayWithObjects:(id)[colorOne CGColor],(id)[colorTwo CGColor], nil]];
    //每种颜色最亮的位置
//    [gradientLayer setLocations:@[@.5,@.5]];
    //渐变的方向StartPoint－>EndPoint
    [gradientLayer setStartPoint:CGPointMake(0, 0.8)];
    [gradientLayer setEndPoint:CGPointMake(0.7, 1)];
    [self.loginBtn.layer addSublayer:gradientLayer];
    [self.loginBtn setShearRound:5 masksToBounds:YES borderWidth:0 borderColor:nil];
    // Do any additional setup after loading the view from its nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (IBAction)skipLogin:(id)sender {
    [self.navigationController setNavigationBarHidden:NO animated:NO];
    [self.navigationController pushViewController:[[SelectEquipmentVC alloc]init] animated:YES];
}
- (IBAction)loginBtnClick:(id)sender {
    [self.navigationController setNavigationBarHidden:NO animated:NO];
    [self.navigationController pushViewController:[[LoginVC alloc]init] animated:YES];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
